layui.define
(['table'], function (exports) {
	/* 定义object对象【start】 */
	var object = {
		init:function (c) {this.f(c);this.load();return object;},
		c: {data:[]}, // 配置项
		f: function (c) { // 数据初始化
			var s = new Date().getTime(),t = this;
			/* YsGrid基本配置，格式：
			{
				"id": "id_form_for_search",
				"conditions": [{}]
			}
			 */
			t.c = c;
			t.c.menuId = c.menuId;
			t.c.id_table_main = c.id_table_main;
			t.c.gridObj = c.gridObj;
		},
		load:function () { // 加载控件
			this.listenBtn();
		},
		listenBtn:function () { // 添加监听
			var t = this;
			// 工具栏事件
			layui.table.on('toolbar(' + t.c.id_table_main + ')', function(obj){
				var id = obj.config.id;
				var checkStatus = layui.table.checkStatus(id);
				var datas = checkStatus.data;
				var othis = lay(this);
				
				if(t.c.menuId == 13) { // 按钮监听-【菜单管理】
					t.listenMenu13(obj, datas);
				} else if(t.c.menuId == 17) { // 按钮监听-【历年店铺订单】
					t.listenMenu17(obj, datas);
				} else if(t.c.menuId == 18) { // 按钮监听-【店铺日报表】
					t.listenMenu18(obj, datas);
				} else if(t.c.menuId == 19) { // 按钮监听-【商品日报表】
					t.listenMenu19(obj, datas);
				} else if(t.c.menuId == 20) { // 按钮监听-【】
					t.listenMenu20(obj, datas);
				} else if(t.c.menuId == 27) { // 按钮监听-【】
					t.listenMenu27(obj, datas);
				}else if(t.c.menuId == 28) { // 按钮监听-【】
					t.listenMenu28(obj, datas);
				} else if(t.c.menuId == 29) { // 按钮监听-【】
					t.listenMenu29(obj, datas);
				} else if(t.c.menuId == 30) { // 按钮监听-【】
					t.listenMenu30(obj, datas);
				} else if(t.c.menuId == 32) { // 按钮监听-【】
					t.listenMenu32(obj, datas);
				} else if(t.c.menuId == 37) { // 按钮监听-【】
					t.listenMenu37(obj, datas);
				} else if(t.c.menuId == 38) { // 按钮监听-【】
					t.listenMenu38(obj, datas);
				} else if(t.c.menuId == 41) { // 按钮监听-【】
					t.listenMenu41(obj, datas);
				} else if(t.c.menuId == 47) { // 按钮监听-【】
					t.listenMenu47(obj, datas);
				} else if(t.c.menuId == 51) { // 按钮监听-【】
					t.listenMenu51(obj, datas);
				} else if(t.c.menuId == 52) { // 按钮监听-【】
					t.listenMenu52(obj, datas);
				} else if(t.c.menuId == 53) { // 按钮监听-【】
					t.listenMenu53(obj, datas);
				} else if(t.c.menuId == 54) { // 按钮监听-【】
					t.listenMenu54(obj, datas);
				} else if(t.c.menuId == 55) { // 按钮监听-【】
					t.listenMenu55(obj, datas);
				} else if(t.c.menuId == 57) { // 按钮监听-【】
					t.listenMenu57(obj, datas);
				} else if(t.c.menuId == 59) { // 按钮监听-【】
					t.listenMenu59(obj, datas);
				} else if(t.c.menuId == 63) { // 按钮监听-【】
					t.listenMenu63(obj, datas);
				} else if(t.c.menuId == 65) { // 按钮监听-【】
					t.listenMenu65(obj, datas);
				} else if(t.c.menuId == 66) { // 按钮监听-【】
					t.listenMenu66(obj, datas);
				} else if(t.c.menuId == 67) { // 按钮监听-【】
					t.listenMenu67(obj, datas);
				} else if(t.c.menuId == 70) { // 按钮监听-【】
					t.listenMenu70(obj, datas);
				} else if(t.c.menuId == 71) { // 按钮监听-【】
					t.listenMenu71(obj, datas);
				} else if(t.c.menuId == 72) { // 按钮监听-【】
					t.listenMenu72(obj, datas);
				} else if(t.c.menuId == 73) { // 按钮监听-【】
					t.listenMenu73(obj, datas);
				} else if(t.c.menuId == 74) { // 按钮监听-【】
					t.listenMenu74(obj, datas);
				} else if(t.c.menuId == 76) { // 按钮监听-【】
					t.listenMenu76(obj, datas);
				} else if(t.c.menuId == 81) { // 按钮监听-【】
					t.listenMenu81(obj, datas);
				} else if(t.c.menuId == 82) { // 按钮监听-【】
					t.listenMenu82(obj, datas);
				} else if(t.c.menuId == 85) { // 按钮监听-【】
					t.listenMenu85(obj, datas);
				} else if(t.c.menuId == 100) { // 按钮监听-【】
					t.listenMenu100(obj, datas);
				} else if(t.c.menuId == 102) { // 按钮监听-【】
					t.listenMenu102(obj, datas);
				} else if(t.c.menuId == 108) { // 按钮监听-【】
					t.listenMenu108(obj, datas);
				} else if(t.c.menuId == 109) { // 按钮监听-【】
					t.listenMenu109(obj, datas);
				} else if(t.c.menuId == 119) { // 按钮监听-【】
					t.listenMenu119(obj, datas);
				} else if(t.c.menuId == 120) { // 按钮监听-【】
					t.listenMenu120(obj, datas);
				} else if(t.c.menuId == 122) { // 按钮监听-【】
					t.listenMenu122(obj, datas);
				} else if(t.c.menuId == 123) { // 按钮监听-【】
					t.listenMenu123(obj, datas);
				} else if(t.c.menuId == 124) { // 按钮监听-【】
					t.listenMenu124(obj, datas);
				} else if(t.c.menuId == 125) { // 按钮监听-【】
					t.listenMenu125(obj, datas);
				} else if(t.c.menuId == 126) { // 按钮监听-【】
					t.listenMenu126(obj, datas);
				} else if(t.c.menuId == 127) { // 按钮监听-【】
					t.listenMenu127(obj, datas);
				} else if(t.c.menuId == 128) { // 按钮监听-【】
					t.listenMenu128(obj, datas);
				} else if(t.c.menuId == 136) { // 按钮监听-【】
					t.listenMenu136(obj, datas);
				} else if(t.c.menuId == 140) { // 按钮监听-【】
					t.listenMenu140(obj, datas);
				} else if(t.c.menuId == 141) { // 按钮监听-【】
					t.listenMenu141(obj, datas);
				} else if(t.c.menuId == 10142) { // 按钮监听-【】
					t.listenMenu10142(obj, datas);
				} else if(t.c.menuId == 10151) { // 按钮监听-【】
					t.listenMenu10151(obj, datas);
				} else if(t.c.menuId == 10156) { // 按钮监听-【】
					t.listenMenu10156(obj, datas);
				} else if(t.c.menuId == 10160) { // 按钮监听-【】
					t.listenMenu10160(obj, datas);
				} else if(t.c.menuId == 10163) { // 按钮监听-【】
					t.listenMenu10163(obj, datas);
				} else if(t.c.menuId == 10165) { // 按钮监听-【】
					t.listenMenu10165(obj, datas);
				} else if(t.c.menuId == 10166) { // 按钮监听-【】
					t.listenMenu10166(obj, datas);
				} else if(t.c.menuId == 10167) { // 按钮监听-【】
					t.listenMenu10167(obj, datas);
				} else if(t.c.menuId == 10168) { // 按钮监听-【精品库】
					t.listenMenu10168(obj, datas);
				} else if(t.c.menuId == 10169) { // 按钮监听-【】
					t.listenMenu10169(obj, datas);
				} else if(t.c.menuId == 10171) { // 按钮监听-【】
					t.listenMenu10171(obj, datas);
				} else if(t.c.menuId == 10180) { // 按钮监听-【】
					t.listenMenu10180(obj, datas);
				} else if(t.c.menuId == 10182) { // 按钮监听-【组织机构管理】
					t.listenMenu10182(obj, datas);
				} else if(t.c.menuId == 10184) { // 按钮监听-【Listing库】
					t.listenMenu10184(obj, datas);
				} else if(t.c.menuId == 10192) { // 按钮监听-【Listing库】
					t.listenMenu10192(obj, datas);
				} else if(t.c.menuId == 10178) { // 按钮监听-【Listing申请】
					t.listenMenu10178(obj, datas);
				} else if(t.c.menuId == 10195) { // 按钮监听-【图标管理】
					t.listenMenu10195(obj, datas);
				} else if(t.c.menuId == 10199) { // 按钮监听-【预约调拨单】
					t.listenMenu10199(obj, datas);
				} else if(t.c.menuId == 10206) { // 按钮监听-【手工分配单】
					t.listenMenu10206(obj, datas);
				} else if(t.c.menuId == 10201) { // 按钮监听-【运营人员登记】
					t.listenMenu10201(obj, datas);
				} else if(t.c.menuId == 10203) { // 按钮监听-【预约调拨单】
					t.listenMenu10203(obj, datas);
				} else if(t.c.menuId == 10207) { // 按钮监听-【预约调拨取消单】
					t.listenMenu10207(obj, datas);
				} else if(t.c.menuId == 10205) { // 按钮监听-【员工入职申请】
					t.listenMenu10205(obj, datas);
				} else if(t.c.menuId == 10208) { // 按钮监听-【人员档案】
					t.listenMenu10208(obj, datas);
				} else if(t.c.menuId == 10219) { // 按钮监听-【邮件标签】
					t.listenMenu10219(obj, datas);
				}else if(t.c.menuId == 10227) { // 按钮监听-【万里汇账户管理】
					t.listenMenu10227(obj, datas);
				}else if(t.c.menuId == 10229) { // 按钮监听-【万里汇历史余额】
					t.listenMenu10229(obj, datas);
				}else if(t.c.menuId == 10231) { // 按钮监听-【万里汇多账号管理】
					t.listenMenu10231(obj, datas);
				}
			});
	    },
	    listenMenu13: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-batch-update':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');10184
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "批量导入更新",
					        content: '/web/sys/tsDictionaryForModule/toImportForUpdate?guid=' + datas[0].guid
					    });
					}
					break;
				}
			};
	    },
	    listenMenu17: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-refresh-order':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "刷新店铺订单",
				        content: '/web/business/tpAmazonShopOrder/toRefreshOrder'
				    });
					break;
				}
				case 'event-export-update':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpAmazonShopOrder/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
				case 'event-to-export':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "导出表格",
				        content: '/web/business/tpYsbExportLog/toExport?menuId=17'
				    });
					break;
				}
			};
	    },
	    listenMenu18: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tcoDayShop/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
	    },
	    listenMenu19: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpAmazonShopOrderDaily/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
	    },
	    listenMenu20: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-addRunningBack':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选择一条数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "生成费用返还单",
							content: '/web/finance/tcwRunningBack/toAddRunningBack?id=' + datas[0].id
					   });
					}
					break;
				}
				case 'event-to-export':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "导出表格",
				        content: '/web/business/tpYsbExportLog/toExport?menuId=20'
				    });
					break;
				}
			};
	    },
	    listenMenu27: function(obj, datas) {
	    	var t = this;
	    	//t.gridObj.getConds();
			switch(obj.event){
				case 'event-to-export'://导出
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "导出表格",
						content: '/web/business/tpYsbExportLog/toExport?menuId=27'
					});
					break;
				}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpProductBasis/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
	    },
		listenMenu28: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-export'://导出
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "导出表格",
						content: '/web/business/tpYsbExportLog/toExport?menuId=28'
					});
					break;
				}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpProductBasisChildNew/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
	    },
	    listenMenu29: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add': {
					var w = ($(window).width() * 0.9);
					var h = ($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w + 'px', h + 'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade: 0.4,
						title: "新增商品",
						content: '/web/business/tpProductXP/toAdd'
					});
					break;
				}
				case 'event-to-edit': {
					if (datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if (datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w = ($(window).width() * 0.9);
						var h = ($(window).height() - 50);
						var index = layer.open({
							type: 2, area: [w + 'px', h + 'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade: 0.4,
							title: "修改",
							content: '/web/business/tpProductXP/toEdit?id=' + datas[0].id
						});
					}
					break; 
				}
				case 'event-to-delete': {
					if (datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for (var i = 0; i < datas.length; i++) {
							_list[i] = datas[i].id;
						}
						layer.confirm('确定要删除吗？', { icon: 3 }, function() {
							layer.msg('处理中', { icon: 16, shade: 0.01 });
							$.ajax({
								url: '/api/inter/tpProductXPdx/deleteTrue',
								data: "list=" + _list,
								type: 'POST',
								async: true,
								success: function(res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								}, error: function() {
									layer.close();
									layer.msg("删除失败，请稍后再试！", { icon: 2 });
								}
							});
						}, function() {
						});
					}
					break;
				}
			};
	    },
	    listenMenu30: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w = ($(window).width() * 0.9);
					var h = ($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w + 'px', h + 'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade: 0.4,
						title: "新增商品",
						content: '/web/business/tpProductXP/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if (datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if (datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w = ($(window).width() * 0.9);
						var h = ($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w + 'px', h + 'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade: 0.4,
							title: "修改",
							content: '/web/business/tpProductXP/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
				case 'event-to-delete':
				{
					if (datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for (var i = 0; i < datas.length; i++) {
							_list[i] = datas[i].id;
						}
						layer.confirm('确定要删除吗？', {
							icon: 3
						}, function() {
							layer.msg('处理中', {
								icon: 16,
								shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tpProductXPyx/deleteTrue',
								data: "list=" + _list,
								type: 'POST',
								async: true,
								success: function(res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function() {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {
										icon: 2
									});
								}
							});
						}, function() {});
					}
					break;
				}
			};
	    },
	    listenMenu32: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add': {
					var w = ($(window).width() * 0.9);
					var h = ($(window).height() - 50);
					var index = layer.open({
						type: 2, area: [w + 'px', h + 'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade: 0.4,
						title: "新增商品",
						content: '/web/business/tpProductCarefullyChosenNew/toAdd'
					});
					break;
				}
			};
	    },
	    listenMenu37: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增角色",
				        content: '/web/sys/ysRole/toAdd'
				    });
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "编辑",
					        content: '/web/sys/ysRole/toEdit?id=' + datas[0].id
					    });
					}
					break;
				}
			};
	    },
	    listenMenu38: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增",
				        content: '/web/sys/tsUserInfo/toAdd'
				    });
					break;
				}
				case 'event-to-batch-change-org':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var ids = '';
						for(var i = 0 ;i < datas.length; i++){
							ids += datas[i].id + ',';
						}
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "批量变更组织机构",
					        content: '/web/sys/tsUserInfo/toBatchChangeOrg?ids=' + ids.substring(0, ids.length - 1)
					    });
					}
					break;
				}
			};
	    },
	    listenMenu41: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增流程模型",
				        content: '/web/flow/yspModel/toAdd'
				    });
					break;
				}
			};
	    },
	    listenMenu47: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-reset':
				{
					layer.open({
						title:'重新统计数据',
						type: 2,
						area: ['600px', '400px'],
						fix: true, maxmin: false, shadeClose: true, shade:0.4,shade:0.5,
						content:'/web/business/tpTimeCheck/toTimeCheckRefresh'
					});
					break;
				}
			};
	    },
	    listenMenu51: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增运营公司备案",
				        content: '/web/hr/thrOperateCompanyBeian/toAdd'
				    });
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "编辑",
					        content: '/web/hr/thrOperateCompanyBeian/toEdit?id=' + datas[0].id
					    });
					}
					break;
				}
			};
	    },
	    listenMenu52: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-editOperator':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "修改运营人",
					        content: '/web/hr/thrOperateCompanyInfo/toEditOperator?id=' + datas[0].id
					    });
					}
					break;
				}
				case 'event-to-editStatus':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "修改运营状态",
					        content: '/web/hr/thrOperateCompanyInfo/toEditStatus?id=' + datas[0].id
					    });
					}
					break;
				}
				case 'event-to-batch-change-org':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var ids = '';
						for(var i = 0 ;i < datas.length; i++){
							ids += datas[i].id + ',';
						}
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "批量变更组织机构",
					        content: '/web/hr/thrOperateCompanyInfo/toBatchChangeOrg?ids=' + ids.substring(0, ids.length - 1)
					    });
					}
					break;
				}
			};
	    },
	    listenMenu53: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add': { 
					var w=($(window).width()*0.9); 
					var h=($(window).height() - 50); 
					var index = layer.open({ 
					type: 2, area: [w+'px', h +'px'], fix: true, maxmin: false, shadeClose: true, shade:0.4, title: "新增部门员工评价", 
					content: '/web/business/tpDeptUserPoint/toAdd'
					 }); 
					break; 
					}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "编辑",
							content: '/web/business/tpDeptUserPoint/toDeptUserPointEditOrDetail?id=' + datas[0].id + '&type=1'
					   });
					}
					break;
				}
			};
	    },
	    listenMenu54: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tpShopRegisterPhaseSet/toAdd'
					});
					break;
				}
			};
	    },
	    listenMenu55: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{

					window.matchValuesAfterModalSelectRadio = function(colCode, data, extraData) {
						console.log('data =',data);
						var _list = [data.id];
						/*
						for( var i=0;i<data.length;i++ ){
							_list[i]=data[i].id;
						}
						 */
						layui.layer.msg('处理中', {
							icon: 16,
							shade: 0.01
						});
						$.ajax({
							url: '/api/inter/tpShopRegisterPhaseRecord/add',
							data: "list="+_list,
							type: 'POST',
							async: false,
							success: function (result) {
								if(result.code=='0'){
									layer.close();
									//刷新列表
									setTimeout(function(){
										location.reload();
									}, 1000);
									//return;
								}else {//失败
									layer.close();
									layer.msg(result.msg, {icon: 2});
								}
							},
							error: function () {
								layer.close();
								layer.msg("新增失败，请稍后再试！", {icon: 2});
							}
						});
					};
					layui.YsModal.init({modalKey: 'THR_OperateCompanyApply_NO_ShopRegisterPhaseRecord', colCode: 'aaaa', parentObj: window});
					break;
				}
				case 'event-to-chooseShop':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "选择店铺",
							content: '/web/business/tpShopRegisterPhaseRecord/toChooseShop?id=' + datas[0].id + '&phaseNum=' + datas[0].phaseNum+ '&vGsBm=' + datas[0].vGsBm
					   });
					}
					break;
				}
				case 'event-to-finish':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							if(datas[i].workTime==undefined || datas[i].workTime==null || datas[i].workTime==''){
								_list.push(datas[i].id);
							}
						}
						var finishMsg = '确定要完成选中的跟踪单吗？';
						if(_list==null || _list.length == 0 || _list.length == []){
							finishMsg = '选中的跟踪单已完成，请重新选择！';
							layer.msg(finishMsg, {icon: 0});
							return;
						}
						if(_list!=null && _list.length < datas.length){
							finishMsg = '您选中的跟踪单有部分已完成，完成时将不会更改这些信息，是否继续？';
						}
						layer.confirm(finishMsg, {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tpShopRegisterPhaseRecord/finishRecord',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									layer.msg(res.msg);
									if(res.code==0){
										setTimeout(function(){location.reload();}, 2000);
									}
								},
								error: function () {
									layer.close();
									layer.msg("处理失败，请稍后再试！", {icon: 2});
								}
							});
								
						}, function () {});
						
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].operateCompanyId;
						}
						
						layer.confirm('确定要删除选中的跟踪单吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tpShopRegisterPhaseRecord/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
								
						}, function () {});
						
					}
					break;
				}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpShopRegisterPhaseRecord/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
	    },
	    listenMenu57: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tpShopRegisterPhaseSet/toAdd'
					});
					break;
				}
			};
	    },
	    listenMenu59: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/base/tbRepeatWord/toAdd'
					});
					break;
				}
				case 'event-to-batch-import':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/base/tbRepeatWord/toBatchImport'
					});
					break;
				}
			};
	    },
		listenMenu63: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpShopAnalysisReportForms/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu65: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpShopAnalysisReportForms/exportByCompany',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu66: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpShopAnalysisReportForms/exportByUser',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
	    listenMenu67: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增角色",
				        content: '/web/kefu/tkfKnow/toAdd'
				    });
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "编辑",
					        content: '/web/kefu/tkfKnow/toEdit?id=' + datas[0].id
					    });
					}
					break;
				}
			};
	    },
	    listenMenu70: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "编辑",
					        content: '/web/finance/tcwRunningBack/toFlow?bid=' + datas[0].pbid
					    });
					}
					break;
				}
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/finance/tcwRunningBack/toAdd'
					});
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
						layui.layer.confirm("删除后不可恢复，确定彻底删除？",{
							btn: ['确定', '取消']
						}, function (index) {
							$.ajax({
								type: "POST",
								url: '/api/inter/tcwRunningBack/delete',
								data: {id: row.pid},
								success: function (data) {
									if (data.code == 0) {
										reloadTableOfList();
									} else {
										alert(data.msg);
									}
								}
							});
							layer.close(index);
						});
					}
					break;
				}
				case 'event-to-flow-history':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
			        	var w=($(window).width()*0.9);
			        	var h=($(window).height() - 50);
			            layer.open({
			                type: 2,
			                area: [w+'px', h +'px'],
			                fix: true,
			                maxmin: false,
			                shadeClose: true,
			                shade:0.4,
			                title: "流程跟踪",
			                content: '/web/flow/ysp/toAudit?bid=' + row.pbid
			            });
					}
					break;
				}
			};
	    },
	    listenMenu71: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-setCoefficient':
				{
					var index = layer.open({
						title:'设置目标系数',
					    type: 2,
					    area: ['600px', '400px'],
					    fix: true, maxmin: false, shadeClose: true, shade:0.4,shade:0.5,
					    content:'/web/business/tpAnalysisDailyTargetSet/toSetCoefficient?setType=0'
					});
					break;
				}
				case 'event-to-setDailyTarget':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var index = layer.open({
							title:'设置日目标',
							type: 2,
							area: ['600px', '400px'],
							fix: true, maxmin: false, shadeClose: true, shade:0.4,shade:0.5,
							content:'/web/business/tpAnalysisDailyTargetSet/toSetDailyTarget?id=' + datas[0].id + '&dailyTarget='+ datas[0].dailyTarget+ '&setType=0'
						});
					}
					break;
				}
			};
	    },
		listenMenu72: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpAnalysisDailyTarget/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
	    listenMenu73: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-setCoefficient':
				{
					var index = layer.open({
						title:'设置目标系数',
					    type: 2,
					    area: ['600px', '400px'],
					    fix: true, maxmin: false, shadeClose: true, shade:0.4,shade:0.5,
					    content:'/web/business/tpAnalysisDailyTargetSet/toSetCoefficient?setType=1'
					});
					break;
				}
				case 'event-to-setDailyTarget':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var index = layer.open({
							title:'设置日目标',
							type: 2,
							area: ['600px', '400px'],
							fix: true, maxmin: false, shadeClose: true, shade:0.4,shade:0.5,
							content:'/web/business/tpAnalysisDailyTargetSet/toSetDailyTarget?id=' + datas[0].id + '&dailyTarget='+ datas[0].elaborateDailyTarget+ '&setType=1'
						});
					}
					break;
				}
			};
	    },
		listenMenu74: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpAnalysisDailyTarget/exportByElaborate',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
	    listenMenu76: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增",
				        content: '/web/kefu/tpGaugeMaintenance/toAdd'
				    });
					break;
				}
				case 'event-to-edit':
	            {
	                if(datas.length == 0) {
	                    layer.alert('尚未选中数据');
	                } else if(datas.length > 1) {
	                    layer.alert('只能选中一行数据');
	                } else {
	                    var w=($(window).width()*0.9);
	                    var h=($(window).height() - 50);
	                    var index = layer.open({
	                        type: 2,
	                        area: [w+'px', h +'px'],
	                        fix: true,
	                        maxmin: false,
	                        shadeClose: true,
	                        shade:0.4,
	                        title: "修改",
	                        content: '/web/kefu/tpGaugeMaintenance/toEdit?id=' + datas[0].id
	                    });
	                }
	                break;
	            }
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}
						
						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/kefu/tpGaugeMaintenance/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
								
						}, function () {});
						
					}
					break;
				}
			};
	    },
	    listenMenu81: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-refresh':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "请选择需要刷新的店铺/日期",
						content: '/web/finance/tcwFinancesEventGroups/toAdd'
					});
					break;
				}
			};
	    },
	    listenMenu82: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-export':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "导出表格",
						content: '/web/business/tpYsbExportLog/toExport?menuId=17'
					});
					break;
				}
			};
	    },
	    listenMenu85: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/mall/tmGoods/toAdd'
					});
					break;
				}
				case 'event-to-edit':
	            {
	                if(datas.length == 0) {
	                    layer.alert('尚未选中数据');
	                } else if(datas.length > 1) {
	                    layer.alert('只能选中一行数据');
	                } else {
	                    var w=($(window).width()*0.9);
	                    var h=($(window).height() - 50);
	                    var index = layer.open({
	                        type: 2,
	                        area: [w+'px', h +'px'],
	                        fix: true,
	                        maxmin: false,
	                        shadeClose: true,
	                        shade:0.4,
	                        title: "修改",
	                        content: '/web/mall/tmGoods/toEdit?id=' + datas[0].id
	                    });
	                }
	                break;
	            }
				case 'event-to-resort':
	            {
					layer.open({
						type: 2,
						title: "重新顺序",
						area: ['50%', '90%'],
						content: '/web/mall/tmGoods/toResort'
					});
	                break;
	            }
			};
	    },
	    listenMenu100: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "编辑",
					        content: '/web/mall/tmGiftGiven/toFlow?bid=' + datas[0].bid
					    });
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
						layui.layer.confirm("删除后不可恢复，确定彻底删除？",{
							btn: ['确定', '取消']
						}, function (index) {
							$.ajax({
								type: "POST",
								url: '/api/inter/tmGiftGiven/delete',
								data: {id: row.id},
								success: function (data) {
									if (data.code == 0) {
										reloadTableOfList();
									} else {
										alert(data.msg);
									}
								}
							});
							layer.close(index);
						});
					}
					break;
				}
				case 'event-to-flow-history':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
			        	var w=($(window).width()*0.9);
			        	var h=($(window).height() - 50);
			            layer.open({
			                type: 2,
			                area: [w+'px', h +'px'],
			                fix: true,
			                maxmin: false,
			                shadeClose: true,
			                shade:0.4,
			                title: "流程跟踪",
			                content: '/web/flow/ysp/toAudit?bid=' + row.bid
			            });
					}
					break;
				}
			};
	    },
	    listenMenu102: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "编辑",
					        content: '/web/mall/tmGiftUse/toFlow?bid=' + datas[0].bid
					    });
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
						layui.layer.confirm("删除后不可恢复，确定彻底删除？",{
							btn: ['确定', '取消']
						}, function (index) {
							$.ajax({
								type: "POST",
								url: '/api/inter/tmGiftUse/delete',
								data: {id: row.id},
								success: function (data) {
									if (data.code == 0) {
										reloadTableOfList();
									} else {
										alert(data.msg);
									}
								}
							});
							layer.close(index);
						});
					}
					break;
				}
				case 'event-to-flow-history':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
			        	var w=($(window).width()*0.9);
			        	var h=($(window).height() - 50);
			            layer.open({
			                type: 2,
			                area: [w+'px', h +'px'],
			                fix: true,
			                maxmin: false,
			                shadeClose: true,
			                shade:0.4,
			                title: "流程跟踪",
			                content: '/web/flow/ysp/toAudit?bid=' + row.bid
			            });
					}
					break;
				}
			};
	    },
	    listenMenu108: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add': { 
					var w=($(window).width()*0.9); 
					var h=($(window).height() - 50); 
					var index = layer.open({ 
					type: 2, area: [w+'px', h +'px'], fix: true, maxmin: false, shadeClose: true, shade:0.4, title: "新增", 
					content: '/web/finance/tbPointRunningItem/toAdd'
					}); 
					break; 
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "编辑",
							content: '/web/finance/tbPointRunningItem/toEdit?id=' + datas[0].id
					   });
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
						layui.layer.confirm("删除后不可恢复，确定彻底删除？",{
							btn: ['确定', '取消']
						}, function (index) {
							$.ajax({
								type: "POST",
								url: '/api/inter/ysDict/delete',
								data: {id: row.id},
								success: function (data) {
									if (data.code == 0) {
										reloadTableOfList();
									} else {
										alert(data.msg);
									}
								}
							});
							layer.close(index);
						});
					}
					break;
				}
			};
	    },
	    listenMenu109: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/finance/tcwPointTransfer/toAdd'
					});
					break;
				}
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "审批",
					        content: '/web/finance/tcwPointTransfer/toFlow?bid=' + datas[0].bid
					    });
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
						layui.layer.confirm("删除后不可恢复，确定彻底删除？",{
							btn: ['确定', '取消']
						}, function (index) {
							$.ajax({
								type: "POST",
								url: '/api/inter/tcwPointTransfer/delete',
								data: {id: row.id},
								success: function (data) {
									if (data.code == 0) {
										reloadTableOfList();
									} else {
										alert(data.msg);
									}
								}
							});
							layer.close(index);
						});
					}
					break;
				}
				case 'event-to-flow-history':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
			        	var w=($(window).width()*0.9);
			        	var h=($(window).height() - 50);
			            layer.open({
			                type: 2,
			                area: [w+'px', h +'px'],
			                fix: true,
			                maxmin: false,
			                shadeClose: true,
			                shade:0.4,
			                title: "流程跟踪",
			                content: '/web/flow/ysp/toAudit?bid=' + row.pbid
			            });
					}
					break;
				}
			};
	    },
	    listenMenu119: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					
					window.matchValuesAfterModalSelectRadio = function(colCode, data, extraData) {
						console.log('data =',data);
						var _list = [data.id];
						/*
						for( var i=0;i<data.length;i++ ){
							_list[i]=data[i].id;
						}
						 */
						layui.layer.msg('处理中', {
							icon: 16,
							shade: 0.01
						});
						$.ajax({
							url: '/api/inter/tpShopStopPhaseRecord/add',
							data: "list="+_list,
							type: 'POST',
							async: false,
							success: function (result) {
								if(result.code=='0'){
									layer.close();
									//刷新列表
									setTimeout(function(){
										location.reload();
									}, 1000);
									//return;
								}else {//失败
									layer.close();
									layer.msg(result.msg, {icon: 2});
								}
							},
							error: function () {
								layer.close();
								layer.msg("新增失败，请稍后再试！", {icon: 2});
							}
						});
					};
					layui.YsModal.init({modalKey: 'THR_OperateCompanyApply_NO_ShopStopPhaseRecord', colCode: 'aaaa', parentObj: window});
					//layui.YsModal.init({modalKey: 'THR_OperateCompanyApply_NO_ShopStopPhaseRecord', type: 'checkbox', uniqueKey: 'id',parentObj: window,selectedData: []});
					break;
				}
				case 'event-to-chooseShop':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "选择店铺",
							content: '/web/business/tpShopStopPhaseRecord/toChooseShop?id=' + datas[0].id + '&phaseNum=' + datas[0].phaseNum+ '&vGsBm=' + datas[0].vGsBm
						});
					}
					break;
				}
				case 'event-to-finish':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							if(datas[i].workTime==undefined || datas[i].workTime==null || datas[i].workTime==''){
								_list.push(datas[i].id);
							}
						}
						var finishMsg = '确定要完成选中的跟踪单吗？';
						if(_list==null || _list.length == 0 || _list.length == []){
							finishMsg = '选中的跟踪单已完成，请重新选择！';
							layer.msg(finishMsg, {icon: 0});
							return;
						}
						if(_list!=null && _list.length < datas.length){
							finishMsg = '您选中的跟踪单有部分已完成，完成时将不会更改这些信息，是否继续？';
						}
						layer.confirm(finishMsg, {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tpShopStopPhaseRecord/finishRecord',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									layer.msg(res.msg);
									if(res.code==0){
										setTimeout(function(){location.reload();}, 2000);
									}
								},
								error: function () {
									layer.close();
									layer.msg("处理失败，请稍后再试！", {icon: 2});
								}
							});
	
						}, function () {});
	
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].operateCompanyId;
						}
	
						layer.confirm('确定要删除选中的跟踪单吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tpShopStopPhaseRecord/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
	
						}, function () {});
	
					}
					break;
				}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpShopStopPhaseRecord/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
	    },
	    listenMenu120: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tpShopStopPhaseSet/toAdd'
					});
					break;
				}
			};
	    },
	    listenMenu122: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-edit':
	            {
	                if(datas.length == 0) {
	                    layer.alert('尚未选中数据');
	                } else if(datas.length > 1) {
	                    layer.alert('只能选中一行数据');
	                } else {
	                    var w=($(window).width()*0.9);
	                    var h=($(window).height() - 50);
	                    var index = layer.open({
	                        type: 2,
	                        area: [w+'px', h +'px'],
	                        fix: true,
	                        maxmin: false,
	                        shadeClose: true,
	                        shade:0.4,
	                        title: "修改",
	                        content: '/web/sys/tbStaticConfig/toEdit?id=' + datas[0].id
	                    });
	                }
	                break;
	            }
			};
	    },
	    listenMenu123: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab('商品类目维护 - 新增', '/web/business/tbBaseinfoDwmc/toAdd')
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tbBaseinfoDwmc/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/business/tbBaseinfoDwmc/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}
	
						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tbBaseinfoDwmc/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
	
						}, function () {});
	
					}
					break;
				}
			};
	    },
	    listenMenu124: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab('商品用途维护 - 新增', '/web/business/tbBaseinfoSpyt/toAdd')
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tbBaseinfoSpyt/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/business/tbBaseinfoSpyt/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}
	
						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tbBaseinfoSpyt/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
	
						}, function () {});
	
					}
					break;
				}
			};
	    },
	    listenMenu125: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab('商品类目维护 - 新增', '/web/business/tbBaseinfoLmwh/toAdd')
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tbBaseinfoLmwh/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/business/tbBaseinfoLmwh/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}
	
						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tbBaseinfoLmwh/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
	
						}, function () {});
	
					}
					break;
				}
			};
	    },
	    listenMenu126: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab('商品品类维护 - 新增', '/web/business/tbBaseinfoSppl/toAdd')
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tbBaseinfoSppl/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/business/tbBaseinfoSppl/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}
	
						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tbBaseinfoSppl/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
	
						}, function () {});
	
					}
					break;
				}
			};
	    },
	    listenMenu127: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab('商品品名维护 - 新增', '/web/business/tbBaseinfoSppm/toAdd')
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tbBaseinfoSppm/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/business/tbBaseinfoSppm/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}
	
						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tbBaseinfoSppm/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
	
						}, function () {});
	
					}
					break;
				}
			};
	    },
	    listenMenu128: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab('商品品名维护 - 新增', '/web/business/tbBaseinfoSpcz/toAdd')
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tbBaseinfoSpcz/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/business/tbBaseinfoSpcz/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}
	
						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tbBaseinfoSpcz/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
	
						}, function () {});
	
					}
					break;
				}
			};
	    },
	    listenMenu136: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				//上传至知识库
				case 'event-to-addToLedge':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
						return;
					}
					var ids = '';
					for(var i=0;i<datas.length;i++){
						if(ids==''){
							ids = datas[i].id;
						}else {
							ids = ids+','+datas[i].id;
						}
					}
					layer.open({
						title: '选择要上传的知识库分类',
						type: 2,
						area: [$(window).width()*0.8+'px', ($(window).height() - 50)+'px'],
						content: '/web/eKnowAi/webEKnowAiController/chatLogManageUpload?id='+ids,
						fixed: false, // 不固定
						maxmin: true,
						btnAlign: 'c',
					});
					break;
				}
				case 'event-to-del':
				{
					isDelEKnowLogManage(datas);
					break;
				}
			};
	    },
	    listenMenu140: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增运营公司备案",
						content: '/web/hr/thrOperateCompanyApply/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "编辑",
							content: '/web/hr/thrOperateCompanyApply/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
			};
	    },
	    listenMenu141: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增运营公司备案",
						content: '/web/hr/thrOperateCompanyApply/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "编辑",
							content: '/web/hr/thrOperateCompanyApply/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
			};
	    },
	    listenMenu10142: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-addToManage':
				{
                    if(datas.length == 0) {
                        layer.alert('尚未选中数据');
                        return;
                    }
                    var loadIndex = layer.confirm('确定要将所选择的日志添加至管理?', {icon: 3}, function () {
                        //点击确定的回调
                        layer.close(loadIndex);
                        layer.load(2);
                        var _list = [];
                        for(var i=0;i<datas.length;i++){
                            _list.push(datas[i].id);
                        }
                        $.ajax({
                            url: '/api/inter/eKnowChatLog/chatLogAddManage',
                            data: "list="+_list,
                            type: 'POST',
                            async: true,
                            timeout: 60000,
                            success: function (result) {
                                if(result.code=='SUCCESS'){
                                    layer.closeAll();
                                    layer.msg("操作成功", {icon: 1});
                                    location.reload();
                                }else {//失败
                                    layer.closeAll();
                                    layer.msg("操作失败，请稍后再试！", {icon: 2});
                                }
                            },
                            error: function () {
                                layer.closeAll();
                                layer.msg("操作失败，请稍后再试！", {icon: 2});
                            }
                        });
                    }, function () {return false;});//点击取消的回调
					break;
				}
			};
	    },
	    listenMenu10151: function(obj, datas) {
			switch(obj.event){
				case 'event-to-add':
				{
					layer.open({
						title: '新增',
						type: 2,
						area: [$(window).width()*0.8+'px', ($(window).height() - 50)+'px'],
						content: '/web/eKnowAi/webEKnowAiController/sceneAdd',
						fixed: false, // 不固定
						maxmin: true,
						btnAlign: 'c',
					});
					break;
				}
				case 'event-to-del':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
						layui.layer.confirm("删除后不可恢复，确定彻底删除？",{
							btn: ['确定', '取消']
						}, function (index) {
							var layindex= layer.load(2);
							$.ajax({
								type: "POST",
								url: '/api/inter/eKnowScene/delEKnowScene',
								data: {id: row.id},
								success: function (data) {
									layer.close(layindex);
									if (data.code=='SUCCESS') {
										layer.msg("操作成功", {icon: 1});
										setTimeout(function(){
											window.parent.location.reload();
										}, 1000);
									} else {
										alert("不好意思，系统出现问题了，请稍后重试！");
									}
								}
							});
							layer.close(index);
						});
					}
					break;
				}
			};
	    },
	    listenMenu10156: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/mall/tmCate/toAdd'
					});
					break;
				}
				case 'event-to-edit':
	            {
	                if(datas.length == 0) {
	                    layer.alert('尚未选中数据');
	                } else if(datas.length > 1) {
	                    layer.alert('只能选中一行数据');
	                } else {
	                    var w=($(window).width()*0.9);
	                    var h=($(window).height() - 50);
	                    var index = layer.open({
	                        type: 2,
	                        area: [w+'px', h +'px'],
	                        fix: true,
	                        maxmin: false,
	                        shadeClose: true,
	                        shade:0.4,
	                        title: "修改",
	                        content: '/web/mall/tmCate/toEdit?id=' + datas[0].id
	                    });
	                }
	                break;
	            }
				case 'event-to-resort':
	            {
					layer.open({
						type: 2,
						title: "重新顺序",
						area: ['50%', '90%'],
						content: '/web/mall/tmCate/toResort'
					});
	                break;
	            }
			};
	    },
	    listenMenu10160: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab('商品库 - 新增', '/web/business/tpProductBasis/toAdd')
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增",
				        content: '/web/finance/tcwPointRewardPunish/toAdd'
				    });
					break;
				}
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
					    var index = layer.open({
					        type: 2,
					        area: [w+'px', h +'px'],
					        fix: true,
					        maxmin: false,
					        shadeClose: true,
					        shade:0.4,
					        title: "审批",
					        content: '/web/finance/tcwPointRewardPunish/toFlow?bid=' + datas[0].bid
					    });
					}
					break;
				}
			};
	    },
	    listenMenu10163: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-setting':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "设置",
				        content: '/web/business/tpBoutiqueDiscount/toSetting'
				    });
					break;
				}
			};
	    },
	    listenMenu10165: function(obj, datas) {
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab("印章管理 - 新增","/web/administration/webAdmSignetManageController/toAdd");
					var w=($(window).width()*0.7);
					var h=($(window).height() - 150);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "印章管理 - 新增",
						content: '/web/administration/webAdmSignetManageController/toAdd'
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						//window.top.add_tab("印章管理("+datas[0].code+")","/web/administration/webAdmSignetManageController/toEdit?id="+datas[0].id);
						var w=($(window).width()*0.7);
						var h=($(window).height() - 150);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "印章管理("+datas[0].code+")",
							content: '/web/administration/webAdmSignetManageController/toEdit?id='+datas[0].id
						});
					}
					break;
				}
			};
	    },
	    listenMenu10166: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					t.openUrl("印章申请 - 新增","/web/administration/webAdmUseSignetApplyController/toAdd",1);
					//window.top.add_tab("印章申请 - 新增","/web/administration/webAdmUseSignetApplyController/toAdd");
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						t.openUrl("印章申请("+datas[0].bid+")","/web/administration/webAdmUseSignetApplyController/toEdit?bid="+datas[0].bid,1);
						//window.top.add_tab("印章申请("+datas[0].bid+")","/web/administration/webAdmUseSignetApplyController/toEdit?id="+datas[0].id);
					}
					break;
				}
			};
	    },
	    listenMenu10167: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					t.openUrl('站点维护 - 新增', '/web/base/tpAmazonRegion/toAdd',1);
					//window.top.add_tab('站点维护 - 新增', '/web/base/tpAmazonRegion/toAdd');
					/*
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/business/tbSite/toAdd'
					});

					 */
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						t.openUrl('站点维护('+datas[0].code+') - 编辑', '/web/base/tpAmazonRegion/toEdit?id=' + datas[0].i,1);
						//window.top.add_tab('站点维护('+datas[0].code+') - 编辑', '/web/base/tpAmazonRegion/toEdit?id=' + datas[0].id);
						/*
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/business/tbSite/toEdit?id=' + datas[0].id
						});
						 */
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}
	
						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tbSite/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});
						}, function () {});
					}
					break;
				}
			};
	    },
	    listenMenu10168: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						t.openUrl("精品库("+datas[0].code+")","/web/business/tpBoutique/toEdit?id="+datas[0].id+'&code='+datas[0].code,1);
						//window.top.add_tab("精品库("+datas[0].code+")","/web/business/tpBoutique/toEdit?id="+datas[0].id+'&code='+datas[0].code);
					}
					break;
				}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpBoutique/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
				case 'event-to-setting':
				{
					if (datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if (datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w = ($(window).width() * 0.9);
						var h = ($(window).height() - 50);
						var index = layer.open({
							type: 2, area: [w + 'px', h + 'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade: 0.4,
							title: "修改",
							content: '/web/business/tpBoutique/toSetting?code=' + datas[0].code
						});
					}
					break; 
				}
				case 'event-to-importDetail'://站点信息导入
				{
					t.openImport(10176); // 导入的菜单ID
                    break;
				}
				case 'event-to-import'://主表信息导入
				{
					t.openImport(10168); // 导入的菜单ID
					break;
				}
			};

	    },
	    listenMenu10169: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					layer.open({
						shadeClose:true,
						title: '选择商品属性',
						content: `
							<form class="layui-form">
							  <div class="layui-form-item">
								<select id="commodityProperty" lay-filter="aihao">
									<option value="新品" selected="">新品</option>
									<option value="优品" >优品</option>
									<option value="变体">变体</option>
									<option value="精品">精品</option>
								  </select>
							  </div>
							</form>
							`,
						success: function(layero, index) {
							layui.form.render();
							layero.find('.layui-layer-content').css('overflow', 'unset');
						},
						yes: function (index, layero) {
							$(obj).on('click', window.top.menuItem);
							t.openUrl("商品备案申请 - 新增","/web/business/tpProductBq/toAdd?commodityProperty="+$('#commodityProperty').val(),1);
							//window.top.add_tab("商品备案申请 - 新增","/web/business/tpProductBq/toAdd?commodityProperty="+$('#commodityProperty').val());
							layer.closeAll();
						}
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						t.openUrl("商品备案申请("+datas[0].bid+")","/web/business/tpProductBq/toEdit?id="+datas[0].id+'&commodityProperty='+datas[0].commodityProperty,1);
						//window.top.add_tab("商品备案申请("+datas[0].bid+")","/web/business/tpProductBq/toEdit?id="+datas[0].id+'&commodityProperty='+datas[0].commodityProperty);
					}
					break;
				}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpProductBq/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
				case 'event-to-import'://主表信息导入
				{
					t.openImport(10183); // 导入的菜单ID
					break;
				}
			};
	    },
	    listenMenu10171: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab('商品库 - 新增', '/web/business/tpProductBasis/toAdd')
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增",
				        content: '/web/sys/tsOperateOrg/toAdd'
				    });
					break;
				}
				case 'event-to-edit':
	            {
	                if(datas.length == 0) {
	                    layer.alert('尚未选中数据');
	                } else if(datas.length > 1) {
	                    layer.alert('只能选中一行数据');
	                } else {
						//window.top.add_tab('运营机构管理 - 编辑', '/web/sys/tsOperateOrg/toEdit?id=' + datas[0].id)
						t.openUrl('运营机构管理 - 编辑', '/web/sys/tsOperateOrg/toEdit?id=' + datas[0].id,1);
	                }
	                break;
	            }
			};
	    },
		listenMenu10180: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab("A+申请 - 新增","/web/business/tpAplusSq/toAdd");
					t.openUrl("A+申请 - 新增","/web/business/tpAplusSq/toAdd",1);
					break;
				}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpAplusSq/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
	    },
		listenMenu10182: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/sys/tsOrganizationInfo/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
			}
		},
		listenMenu10184: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
			case 'event-to-detail'://详情
			{
				if(datas.length == 0) {
					layer.alert('尚未选中数据');
				} else if(datas.length > 1) {
					layer.alert('只能选中一行数据');
				} else {
					//window.top.add_tab('Listing库('+datas[0].code+') - 详情', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=detail")
					t.openUrl('Listing库('+datas[0].code+') - 详情','/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=detail",1);
				}
				break;
			}
			case 'event-to-operationsEdit'://运营维护
			{
				if(datas.length == 0) {
					layer.alert('尚未选中数据');
				} else if(datas.length > 1) {
					layer.alert('只能选中一行数据');
				} else {
					t.openUrl('Listing库('+datas[0].code+') - 运营维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=operations",1);
					//window.top.add_tab('Listing库('+datas[0].code+') - 运营维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=operations")
				}
				break;
			}
			case 'event-to-storageEdit'://仓储维护
			{
				if(datas.length == 0) {
					layer.alert('尚未选中数据');
				} else if(datas.length > 1) {
					layer.alert('只能选中一行数据');
				} else {
					t.openUrl('Listing库('+datas[0].code+') - 仓储维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=storage",1);
					//window.top.add_tab('Listing库('+datas[0].code+') - 仓储维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=storage")
				}
				break;
			}
			case 'event-to-logisticsEdit'://物流维护
			{
				if(datas.length == 0) {
					layer.alert('尚未选中数据');
				} else if(datas.length > 1) {
					layer.alert('只能选中一行数据');
				} else {
					t.openUrl('Listing库('+datas[0].code+') - 物流维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=logistics",1);
					//window.top.add_tab('Listing库('+datas[0].code+') - 物流维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=logistics")
				}
				break;
			}
			case 'event-to-purchaseEdit'://采购维护
			{
				if(datas.length == 0) {
					layer.alert('尚未选中数据');
				} else if(datas.length > 1) {
					layer.alert('只能选中一行数据');
				} else {
					t.openUrl('Listing库('+datas[0].code+') - 采购维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=purchase",1);
					//('Listing库('+datas[0].code+') - 采购维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=purchase")
				}
				break;
			}
			case 'event-to-manageEdit'://管理维护
			{
				if(datas.length == 0) {
					layer.alert('尚未选中数据');
				} else if(datas.length > 1) {
					layer.alert('只能选中一行数据');
				} else {

					t.openUrl('Listing库('+datas[0].code+') - 管理维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=manage",1);
					//window.top.add_tab('Listing库('+datas[0].code+') - 管理维护', '/web/business/tpProductActive/toEdit?id=' + datas[0].id+"&editType=manage")
				}
				break;
			}
			case 'event-to-updateVgsbm'://批量修改运营公司编码
			{
				if(datas.length == 0) {
					layer.alert('尚未选中数据');
				} else {
					var codeList = [];
					for(var i=0;i<datas.length;i++){
						codeList.push(datas[i].code);
					}
					window.matchValuesAfterModalSelectRadio = function(colCode, data, extraData) {
						console.log('data =',data);
						//var _list = [data.vGsBm];
						layui.layer.msg('处理中', {
							icon: 16,
							shade: 0.01
						});
						$.ajax({
							type: "POST",
							url: '/api/inter/tpProductActive/updateVgsbm',
							data: "list="+codeList+"&vgsbm="+data.vGsBm,
							success: function (data) {
								if (data.code == 0) {
									layer.msg('修改成功！');
								} else {
									layer.msg(data.msg);
								}
								layer.closeAll();
								setTimeout(function(){
									location.reload();
								}, 1000);
							}
						});
					};
					layui.YsModal.init({modalKey: 'THR_OperateCompanyApply', colCode: 'aaaa', parentObj: window});
					break;
				}
				break;
			}
			case 'event-to-export'://导出
			{
				var w=($(window).width()*0.9);
				var h=($(window).height() - 50);
				var index = layer.open({
					type: 2,
					area: [w+'px', h +'px'],
					fix: true,
					maxmin: false,
					shadeClose: true,
					shade:0.4,
					title: "导出表格",
					content: '/web/business/tpYsbExportLog/toExport?menuId=10184'
				});
				break;
			}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpProductActive/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu10192: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
				    var index = layer.open({
				        type: 2,
				        area: [w+'px', h +'px'],
				        fix: true,
				        maxmin: false,
				        shadeClose: true,
				        shade:0.4,
				        title: "新增",
				        content: '/web/sys/ysGrid/toAdd'
				    });
					break;
				}
			};
		},
		listenMenu10178: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					//window.top.add_tab("Listing申请 - 新增","/web/business/tpProductActiveSq/toAdd");
					t.openUrl("Listing申请 - 新增","/web/business/tpProductActiveSq/toAdd",1);
					break;
				}
				case 'LAYTABLE_EXPORT_DATA':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tpProductActiveSq/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
				case 'event-to-edit':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "修改",
							content: '/web/business/tpProductActiveSq/toEdit?id=' + datas[0].id
						});
					}
					break;
				}
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						var index = layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "编辑",
							content: '/web/business/tpProductActiveSq/toFlow?bid=' + datas[0].bid
						});
					}
					break;
				}
				case 'event-to-flow-history':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var row = datas[0];
						var w=($(window).width()*0.9);
						var h=($(window).height() - 50);
						layer.open({
							type: 2,
							area: [w+'px', h +'px'],
							fix: true,
							maxmin: false,
							shadeClose: true,
							shade:0.4,
							title: "流程跟踪",
							content: '/web/flow/ysp/toAudit?bid=' + row.pbid
						});
					}
					break;
				}
				case 'event-to-delete':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else {
						var _list = [];
						for(var i=0;i<datas.length;i++){
							_list[i]=datas[i].id;
						}

						layer.confirm('确定要删除吗？', {icon: 3}, function () {
							layer.msg('处理中', {
								icon: 16,shade: 0.01
							});
							$.ajax({
								url: '/api/inter/tpProductActiveSq/deleteTrue',
								data: "list="+_list,
								type: 'POST',
								async: true,
								success: function (res) {
									layer.close();
									location.reload();
									layer.msg(res.msg);
								},
								error: function () {
									layer.close();
									layer.msg("删除失败，请稍后再试！", {icon: 2});
								}
							});

						}, function () {});

					}
					break;
				}
			};
		},
	    listenMenu10195: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增图标",
						content: '/web/sys/ysIcon/toAdd'
				   });
					break;
				}
				case 'event-to-batch-import':
				{
					var w=($(window).width()*0.9);
					var h=($(window).height() - 50);
					 var index = layer.open({
						type: 2,
						area: [w+'px', h +'px'],
						fix: true,
						maxmin: false,
						shadeClose: true,
						shade:0.4,
						title: "新增",
						content: '/web/sys/ysIcon/toBatchImport'
					});
					break;
				}
			};
	    },
		listenMenu10199: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					t.openUrl('预约调拨单-新增',"/web/storage/tccAllocate/toAdd",1);
					break;
				}
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var bid = datas[0].bid;
						t.openUrl('预约调拨单编辑-' + bid, '/web/storage/tccAllocate/toFlow?bid=' + bid, 1);
					}
					break;
				}
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tccAllocate/export',

						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu10203: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tcwFinancesEventGroupsOp/export',

						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
				case 'event-to-refresh':
				{
					t.openUrl('请选择需要刷新的店铺/日期',"/web/finance/tcwFinancesEventGroupsOp/toAdd",1);
					break;
				}
			};
		},


		listenMenu10201: function(obj, datas) {
			var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					t.openUrl("运营人员登记 - 新增","/web/hr/thrOperateRegistration/toAdd",1);
					break;
				}
				case 'event-to-edit'://编辑
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						t.openUrl('运营人员登记('+datas[0].userId+') - 编辑','/web/hr/thrOperateRegistration/toEdit?id=' + datas[0].id,1);
					}
					break;
				}
				case 'LAYTABLE_EXPORT_DATA'://导出
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/thrOperateRegistration/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}

			};
		},
		listenMenu10206: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					t.openUrl('手工分配单-新增',"/web/storage/tccDistribute/toAdd",1);
					break;
				}
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var bid = datas[0].bid;
						t.openUrl('手工分配单编辑-' + bid, '/web/storage/tccDistribute/toFlow?bid=' + bid, 1);
					}
					break;
				}
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tccDistribute/export',

						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu10207: function(obj, datas) {
	    	var t = this;
			switch(obj.event){
				case 'event-to-add':
				{
					t.openUrl('预约调拨取消单-新增',"/web/storage/tccAllocateCancel/toAdd",1);
					break;
				}
				case 'event-to-flow':
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						var bid = datas[0].bid;
						t.openUrl('预约调拨取消单编辑-' + bid, '/web/storage/tccAllocateCancel/toFlow?bid=' + bid, 1);
					}
					break;
				}
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/tccAllocateCancel/export',

						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu10205: function(obj, datas) {//员工入职申请
			var t = this;
			switch(obj.event){
				case 'event-to-add'://新增
				{
					t.openUrl('员工入职申请 - 新增','/web/hr/thrUserEntryApply/toAdd',1);
					break;
				}
				case 'event-to-edit'://编辑
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						t.openUrl('员工入职申请('+datas[0].userId+') - 编辑','/web/hr/thrUserEntryApply/toEdit?bid=' + datas[0].bid,1);
					}
					break;
				}
				case 'LAYTABLE_EXPORT_DATA'://导出
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/thrUserEntryApply/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},

		listenMenu10208: function(obj, datas) {//人员档案
			var t = this;
			switch(obj.event){
				case 'event-to-edit'://编辑
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						t.openUrl('人员档案('+datas[0].userId+') - 编辑','/web/hr/thrUserArchives/toEdit?id=' + datas[0].id,1);
					}
					break;
				}
				case 'LAYTABLE_EXPORT_DATA'://导出
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/thrUserArchives/export',
						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu10219: function(obj, datas) {// 邮件标签
			var t = this;
			switch(obj.event){
				case 'event-to-add'://新增
				{
					t.openUrl('邮件标签 - 新增','/web/mail/mailTag/toAdd',1);
					break;
				}
				case 'event-to-edit'://编辑
				{
					if(datas.length == 0) {
						layer.alert('尚未选中数据');
					} else if(datas.length > 1) {
						layer.alert('只能选中一行数据');
					} else {
						t.openUrl('邮件标签 - 编辑', '/web/mail/mailTag/toEdit?id=' + datas[0].id, 1);
					}
					break;
				}
			};
		},

		listenMenu10227: function(obj, datas) {//万里汇账户管理
			var t = this;
			switch(obj.event){
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/wfSubUser/export',

						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu10229: function(obj, datas) {//万里汇历史余额
			var t = this;
			switch(obj.event){
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/wfHistoricalBalance/export',

						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},
		listenMenu10231: function(obj, datas) {//万里汇多账号管理
			var t = this;
			switch(obj.event){
				case 'event-to-export':
				{
					$.ajax({
						type: "POST",
						url: '/api/inter/wfStore/export',

						data: t.c.gridObj.getConds(2),
						success: function (data) {
							if (data.code == 0) {
								if(data.msg != undefined && data.msg.startsWith('http')) {
									window.open(data.msg);
								} else {
									layer.msg(data.msg);
								}
							} else {
								alert(data.msg);
							}
						}
					});
					break;
				}
			};
		},


	    isFrom1_0: function() {
			if(window.top.isMobile!=undefined || window.top.isMobile!=null) {
				return false;
			} else {
				return true;
			}
	    },
	    openUrl: function(title, url, toType) { // toType，打开页面方式，1标签页2新页面
	    	var isOn1_0 = this.isFrom1_0();
	    	if (isOn1_0 == true) {
				window.open(url);
			} else {
				if (toType != null && toType != undefined) {
					if (toType == 1) {
						window.top.add_tab(title,url);
					} else {
						window.open(url);
					}
				}
			}
	    },
	    /*
	     * 打开导入弹出框
	     */
	    openImport: function(menuId) {
	    	var t = this;
			$.ajax({
				type: "POST",
				url: '/api/inter/ysMenu/importConfig',
				data: {menuId: menuId},
				success: function (data) {
					if (data.code == 0) {
						t.importMenuId = data.data.menuId;
						t.importFileName = data.data.fileName;
						t.importFields = data.data.nameValMap;
						t.openImport2();
					} else {
						alert(data.msg);
					}
				}
			});
	    },
	    openImport2: function() {
	    	var t = this;
	    	var content =
	    		`<form enctype="multipart/form-data" style="margin-top:20px; margin-bottom:10px;">`
	    			+ `<div style="margin-left:8%">`
	    				+ `<input type="file" id="file" name="file"/>`
	    				+ `<div style="margin-top: 10px; padding-top: 5px;">`
	    					+ `<a href="javascript:void(0);" class="layui-btn layui-btn-xs" data-filter="_import_btn_download_template"><i class="iconfont icon-format-exl"></i> 下载模板</a>`
	    				+ `</div>`
	    				+ `<font color="red" class="pull-left" style="margin-top: 10px;">提示：仅允许导入“xls”或“xlsx”格式文件！</font>`
	    			+ `</div>`
	    		+ `</form>`
	    		+ `<script type="text/javascript" src="/static/plugins/xlsxFull/xlsx.full.min.js"></script>`;
	    	
            layer.open({
                type: 1,
                area: ['400px', '230px'],
                fix: false, 
                offset: '10%',
                maxmin: true,
                shade: 0.3,
                title: '导入',
                content: content,
                btn: ['<i class="layui-icon layui-icon-ok"></i> 导入', '<i class="layui-icon layui-icon-close"></i> 取消'],
                shadeClose: true,
                zIndex: 1000,
                btn1: function (index, layero) {
                    var file = layero.find('#file');
                    if (!file[0]['value']) {
                        layer.msg("请选择文件！");
                        return false;
                    }
                    t.readExcelList(file[0], t.importFields);
                },
				success: function(layero, index) {
					// 绑定下载模板按钮
					$('a[data-filter="_import_btn_download_template"]').on('click',function (e) {

						var indexOfLoading = layer.load(1, {
							shade: [0.5,'#000000'] //0.1透明度的白色背景
						});
						
						$.ajax({
							type: 'post',
							url: '/api/inter/common/generateImportTemplate',
							data: {menuId: t.importMenuId},
							dataType: "json",
							success: function (res) {
								const xhr = new XMLHttpRequest();
								xhr.open('GET', res.data.url);
								xhr.responseType = 'blob';
								xhr.onload = function() {
									const blob = xhr.response;
									const link = document.createElement('a');
									link.href = URL.createObjectURL(blob);
									link.download = t.importFileName;
									link.target = "_blank"; // 可选，如果希望在新窗口中下载文件，请取消注释此行
									link.click();
								};
								xhr.send();
								layer.close(indexOfLoading);
							},
							error: function () {
							    alert("加载失败！")
							}
						});
					});
				}
            });
	    },
	    /*
	     * 读取表格数据
	     */
	    readExcelList: function(obj) {
	    	var t = this;
	    	
			var wb;//读取完成的数据
			var rABS = false; //是否将文件读取为二进制字符串
			var iid;
			if(!obj.files) {
				return;
			}
			const IMPORTFILE_MAXSIZE = 1*2048;       //这里可以自定义控制导入文件大小
			var suffix = obj.files[0].name.split(".").slice(-1);
			if(suffix != 'xls' && suffix !='xlsx'){
				layer.msg('导入的文件格式不正确!')
				return
			}
			if(obj.files[0].size/1024 > IMPORTFILE_MAXSIZE){
				layer.msg('导入的表格文件不能大于2M')
				return
			}
			
			var f = obj.files[0];
			var reader = new FileReader();
			var reStr='';
			reader.onload = function(e) {
				var data = e.target.result;
				if(rABS) {
					wb = XLSX.read(btoa(fixdata(data)), {     //手动转化
						type: 'base64'
					});
				} else {
					wb = XLSX.read(data, {
						type: 'binary'
					});
				}
				var strForm=XLSX.utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]);
				var excelData = [], tStr = trStr='';
				for(var i=0; i<strForm.length; i++){
					var trData = {},strFormTr = {};
					$.each(strForm[i], function(si, sv){
						strFormTr[si.replace("*", "")] = sv;
					})
					trStr += '<tr><td style="border:solid 1px #ddd;padding:10px;font-size:14px;text-align: center;">' + Number(i+1) + '</td>';
					// 将NAME-val格式转换成val-name格式
					$.each(t.importFields, function(key,val){
						tStr = strFormTr[key.replace("*", "")] ? strFormTr[key.replace("*", "")] : '';
						trStr += '<td style="border:solid 1px #ddd;text-align:left;padding:10px;font-size:14px;">' + tStr + '</td>';
						trData[val] = tStr;
					})
					trStr += '</tr>';
					excelData.push(trData);
				}
			    var thStr = '<tr><th style="background:#eee;color:#3366cc;border:solid 1px #ddd;text-align:left;padding:10px;font-size:14px;"><div style="width:30px;">序号</div></th>';
				t.showImportTable(excelData);
			    $.each(t.importFields, function (i, val) {
			        thStr += '<th><div style="background:#eee;color:#3366cc;border:solid 1px #ddd;text-align:left;padding:10px;font-size:14px;width:100px;">' + i + '</div></th>';
			    })
				$("#itbody").html(thStr + trStr);
			};
			if(rABS) {
				reader.readAsArrayBuffer(f);
			} else {
				reader.readAsBinaryString(f);
			}
			return true;
	    },
	    /*
	     * 弹出要导入的表格数据
	     */
	    showImportTable: function(listDataObj) {
	    	var t = this;
	    	
	    	var content =
	    		`<div id="iTable" class="display_no">`
					+ `<table class="importTable listext" data-resizable-columns-id="demo-table">`
						+ `<tbody id="itbody"></tbody>`
					+ `</table>`
				+ `</div>`;
	    	layer.open({
	    		type: 1,
	    		area: ['800px', '500px'],
	    		fix: false,
	    		offset: '10%',
	    		maxmin: true,
	    		shade: 0.3,
	    		title: '导入明细',
	    		content: content,//产品信息扩展iForm
	    		btn: ['<i class="layui-icon layui-icon-ok"></i> 确定', '<i class="layui-icon layui-icon-close"></i> 取消'],
	    		shadeClose: true,
	    		zIndex: 1001,
	    		success: function(layero, index){
	    			layui.form.render();
	    		},
	    		btn1: function(index, layero){
	    			var importObj = [],
	    				inum = 0,
	    				onetime = 1,
	    				flag = 1,
	    				oneImportNum = 2, 						//默认一次导入条数
	    				allImportNum = listDataObj.length, 		//数据总量
	    				times = 0;		//请求次数
	    			setTimeout(function(){
	    				if(allImportNum > 9 && allImportNum <= 100){
	    					oneImportNum = 5;
	    				}else if(allImportNum > 100 && allImportNum <= 500){
	    					oneImportNum = 30;
	    				}else if(allImportNum > 500 && allImportNum <= 1000){
	    					oneImportNum = 50;
	    				}else if(allImportNum > 1000){
	    					oneImportNum = 100;
	    				}

	    				times = Math.ceil(allImportNum/oneImportNum);
	    				t.eachImport(listDataObj, 0, oneImportNum, allImportNum, times, 1);
	    				return false;
	    			}, 1000);
	    		}
	    	});
	    },
	    /*
	     * 提交数据到服务端
	     */
	    eachImport: function(listDataObj, startNum, oneImportNum, allImportNum, times, timeNum) {
			var indexOfLoading = layer.load(1, {
				shade: [0.5,'#000000'] //0.1透明度的白色背景
			});
	    	var t = this;
	        var importObj = [];
		    for (var i = startNum; i < startNum + oneImportNum; i++) {
		        if (i >= allImportNum) break;
		        importObj.push(listDataObj[i]);
		    }
		    $.ajaxSettings.async = false;
		    $.post('/api/inter/common/importBatch', {menuId: t.importMenuId, rows: JSON.stringify(importObj)}, function (res) {
		        console.log('当前次数:' + timeNum);
		        importObj = [];
		        timeNum += 1;
		        if (timeNum >= times) {
		        	layer.close(indexOfLoading);
		        	layer.msg(res.msg);
		        }
		    }, "json");
		    setTimeout(function () {
		        if (timeNum <= times) {
		            t.eachImport(listDataObj, startNum + oneImportNum, oneImportNum, allImportNum, times, timeNum);
		        } else {
		        	layer.close(indexOfLoading);
		        }
		    }, 500);
	    }
	};
	/* 定义object对象【end】 */
	
	
	exports('YsGridBtn', object);
});